package particle;

import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;

public class ParticleNode {
	
    double posX;
    double posY;
    double startPosX;
    double startPosY;
     
    Color color;
    ColorData deltaColor; 
    
    double size;
    double deltaSize;
    
    double rotation;
    double deltaRotation;
    
    double timeToLive;
    
    int index;
    
    ModeA aStatus = new ModeA();
    ModeB bStatus = new ModeB();
    
    public ImageView viewQuad = new ImageView();
    
    ParticleNode(){
    }
    
    public boolean isDead(){
    	return timeToLive < 0;
    }
    
    /**
     * modeA: gravity,direction,accelerate
     * */
    static class ModeA{
        double dirX;
        double dirY;
        double accelX;
        double accelY;
    }
    
    /**
     * modeB: radius mode
     * */
    static class ModeB{
    	double angle;
    	double degreesps; //角速度
    	double radius;
    	double deltaRadius;
    }
    
    static class ColorData{
    	double r;
    	double g;
    	double b;
    	double a;
    	public ColorData(double r,double g,double b,double a) {
    		this.r = r;this.g = g;this.b = b;this.a = a;
		}
    	public double getRed() {
    		return r;
    	}
    	public double getGreen() {
    		return g;
    	}
    	public double getBlue() {
    		return b;
    	}
    	public double getOpacity() {
    		return a;
    	}
    }
}
